//
//  EFALoginModel.h
//  efairy
//
//  Created by XiangDongMBP on 2017/7/26.
//  Copyright © 2017年 East. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <YYModel.h>

typedef NS_ENUM(NSInteger, EFALoginUserRole) {
    EFALoginUserRoleSuper = 0,   //!< 超级管理员
    EFALoginUserRole1stAgency,   //!< 总监+
    EFALoginUserRole2ndAgency,   //!< 总监
    EFALoginUserRoleAdmin,       //!< 管理员
    EFALoginUserRoleNormal,      //!< 普通用户
};

@interface EFALoginUserInfo : NSObject<NSCoding>
@property (nonatomic, assign) NSInteger efairyuser_id;                  //!< 用户唯一id
@property (nonatomic, copy)   NSString *efairyuser_phonenumber;         //!< 用户手机号
@property (nonatomic, copy)   NSString *efairyuser_nickname;            //!< 昵称
@property (nonatomic, copy)   NSString *efairyuser_headimg_url;         //!< 头像
@property (nonatomic, copy)   NSString *efairyuser_country;             //!< 国籍
@property (nonatomic, copy)   NSString *efairyuser_company;             //!< 公司
@property (nonatomic, copy)   NSString *efairyuser_company_address;     //!< 公司地址
@property (nonatomic, copy)   NSString *efairyuser_city;                //!< 城市
@property (nonatomic, copy)   NSString *efairyuser_province;            //!< 省份
@property (nonatomic, copy)   NSString *efairyuser_district;            //!< 区域
@property (nonatomic, copy)   NSString *efairyuser_device_supplier;     //!< 设备提供商
@property (nonatomic, copy)   NSString *efairyuser_email;               ///< E-mail
@property (nonatomic, copy)   NSString *efairyuser_introduce;           ///< 简介
@property (nonatomic, copy)   NSString *efairyuser_registeration_time;  //!< 生
@property (nonatomic, copy)   NSString *efairyuser_wx_openid;           //!<
@property (nonatomic, copy)   NSString *efairyuser_wx_unionid;          //!<
@property (nonatomic, assign) NSInteger efairyuser_sex;                 //!< 性别：0-女 1-男 2-未知
@property (nonatomic, assign) NSInteger efairyuser_last_login_method;   //!< 登录方式：0-普通登录 1-微信登录
@property (nonatomic, copy)   NSString *efairyuser_last_login_time;     //!< 最后登录时间
@property (nonatomic, assign) NSInteger efairyrole_level;   ///< 0-超级管理员 1-总监+ 2-总监 3-项目管理员 4-普通用户
@property (nonatomic, assign) NSInteger efairyuser_belong_user_id;      ///< 用户ID
@property (nonatomic, assign) NSInteger efairyuser_msgobj_id; // 用户消息体编号

@property (nonatomic, readonly) NSString *efairyrole_name;  ///< 角色昵称
@end

@interface EFALoginModel : NSObject<NSCoding>
@property (nonatomic, copy)   NSString *access_token;       ///< 请求令牌，以后的操作均需要带上这个token
@property (nonatomic, copy)   NSString *rongcloud_token;    ///< 融云的Token
@property (nonatomic, strong) EFALoginUserInfo *user_info;

- (NSString *)roleNameWithRoleId:(NSInteger)roleId;
@end
